Optimal. Leaf size=68 \[ -\frac {\sqrt {-x^2-x+2}}{x}+\frac {\tanh ^{-1}\left (\frac {4-x}{2 \sqrt {2} \sqrt {-x^2-x+2}}\right )}{2 \sqrt {2}}+\sin ^{-1}\left (\frac {1}{3} (-2 x-1)\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.04, antiderivative size = 68, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {732, 843, 619, 216, 724, 206} \[ -\frac {\sqrt {-x^2-x+2}}{x}+\frac {\tanh ^{-1}\left (\frac {4-x}{2 \sqrt {2} \sqrt {-x^2-x+2}}\right )}{2 \sqrt {2}}+\sin ^{-1}\left (\frac {1}{3} (-2 x-1)\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 206
Rule 216
Rule 619
Rule 724
Rule 732
Rule 843
Rubi steps
\begin {align*} \int \frac {\sqrt {2-x-x^2}}{x^2} \, dx &=-\frac {\sqrt {2-x-x^2}}{x}+\frac {1}{2} \int \frac {-1-2 x}{x \sqrt {2-x-x^2}} \, dx\\ &=-\frac {\sqrt {2-x-x^2}}{x}-\frac {1}{2} \int \frac {1}{x \sqrt {2-x-x^2}} \, dx-\int \frac {1}{\sqrt {2-x-x^2}} \, dx\\ &=-\frac {\sqrt {2-x-x^2}}{x}+\frac {1}{3} \operatorname {Subst}\left (\int \frac {1}{\sqrt {1-\frac {x^2}{9}}} \, dx,x,-1-2 x\right )+\operatorname {Subst}\left (\int \frac {1}{8-x^2} \, dx,x,\frac {4-x}{\sqrt {2-x-x^2}}\right )\\ &=-\frac {\sqrt {2-x-x^2}}{x}+\sin ^{-1}\left (\frac {1}{3} (-1-2 x)\right )+\frac {\tanh ^{-1}\left (\frac {4-x}{2 \sqrt {2} \sqrt {2-x-x^2}}\right )}{2 \sqrt {2}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.03, size = 68, normalized size = 1.00 \[ -\frac {\sqrt {-x^2-x+2}}{x}+\frac {\tanh ^{-1}\left (\frac {4-x}{2 \sqrt {2} \sqrt {-x^2-x+2}}\right )}{2 \sqrt {2}}+\sin ^{-1}\left (\frac {1}{3} (-2 x-1)\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 1.23, size = 92, normalized size = 1.35 \[ \frac {\sqrt {2} x \log \left (-\frac {4 \, \sqrt {2} \sqrt {-x^{2} - x + 2} {\left (x - 4\right )} + 7 \, x^{2} + 16 \, x - 32}{x^{2}}\right ) + 8 \, x \arctan \left (\frac {\sqrt {-x^{2} - x + 2} {\left (2 \, x + 1\right )}}{2 \, {\left (x^{2} + x - 2\right )}}\right ) - 8 \, \sqrt {-x^{2} - x + 2}}{8 \, x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.25, size = 168, normalized size = 2.47 \[ -\frac {1}{4} \, \sqrt {2} \log \left (\frac {{\left | -4 \, \sqrt {2} + \frac {2 \, {\left (2 \, \sqrt {-x^{2} - x + 2} - 3\right )}}{2 \, x + 1} + 6 \right |}}{{\left | 4 \, \sqrt {2} + \frac {2 \, {\left (2 \, \sqrt {-x^{2} - x + 2} - 3\right )}}{2 \, x + 1} + 6 \right |}}\right ) + \frac {6 \, {\left (\frac {3 \, {\left (2 \, \sqrt {-x^{2} - x + 2} - 3\right )}}{2 \, x + 1} + 1\right )}}{\frac {6 \, {\left (2 \, \sqrt {-x^{2} - x + 2} - 3\right )}}{2 \, x + 1} + \frac {{\left (2 \, \sqrt {-x^{2} - x + 2} - 3\right )}^{2}}{{\left (2 \, x + 1\right )}^{2}} + 1} - \arcsin \left (\frac {2}{3} \, x + \frac {1}{3}\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.06, size = 88, normalized size = 1.29 \[ \frac {\sqrt {2}\, \arctanh \left (\frac {\left (-x +4\right ) \sqrt {2}}{4 \sqrt {-x^{2}-x +2}}\right )}{4}-\arcsin \left (\frac {2 x}{3}+\frac {1}{3}\right )-\frac {\left (-x^{2}-x +2\right )^{\frac {3}{2}}}{2 x}-\frac {\sqrt {-x^{2}-x +2}}{4}+\frac {\left (-2 x -1\right ) \sqrt {-x^{2}-x +2}}{4} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 1.83, size = 59, normalized size = 0.87 \[ \frac {1}{4} \, \sqrt {2} \log \left (\frac {2 \, \sqrt {2} \sqrt {-x^{2} - x + 2}}{{\left | x \right |}} + \frac {4}{{\left | x \right |}} - 1\right ) - \frac {\sqrt {-x^{2} - x + 2}}{x} + \arcsin \left (-\frac {2}{3} \, x - \frac {1}{3}\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.06, size = 73, normalized size = 1.07 \[ \frac {\sqrt {2}\,\ln \left (\frac {2}{x}+\frac {\sqrt {2}\,\sqrt {-x^2-x+2}}{x}-\frac {1}{2}\right )}{4}-\frac {\sqrt {-x^2-x+2}}{x}+\ln \left (x\,1{}\mathrm {i}+\sqrt {-x^2-x+2}+\frac {1}{2}{}\mathrm {i}\right )\,1{}\mathrm {i} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\sqrt {- \left (x - 1\right ) \left (x + 2\right )}}{x^{2}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________